<?PHP
include_once("checklogin.php");
class file
{
	public $content="";
	public $filename="";
	public $dir="";
}
$f=new file;
if(isset($_POST['filename'])&&isset($_POST['dir']))
{
	$f->filename=$_POST['filename'];
	$f->dir=$_POST['dir'];
	$fp=fopen($_SESSION['dir'] . '/' . $_POST['dir'] . '/' . $_POST['filename'],'r');
	$f->content=base64_encode(fread($fp,filesize($_SESSION['dir'] . '/' . $_POST['dir'] . '/' . $_POST['filename'])));
	fclose($fp);
	echo json_encode($f);
}
?>